// tabBarComponent/tabBar.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tabbar: {
      type: Object,
      value: {
        "backgroundColor": "#3cb672",
        "color": "#888",
        "selectedColor": "#3cb672",
        "list": [
        ]
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    isIphoneX: app.globalData.systemInfo.model == "iPhone X" ? true : false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    scanWX: function () {
      var that = this;
      var show;
      wx.scanCode({
        success: (res) => {
          var productId = res.result
          wx.navigateTo({
            url: '/pages/productDetailIndex/index?id='+productId,
          })
        },
        fail: (res) => {
          wx.showToast({
            title: '失败',
            icon: 'success',
            duration: 2000
          })
        },
        complete: (res) => {
        }  
      })
    }
  }
})
